﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:my="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" x:Class="QuickWeather.Widget"
    Title="SeeThru" Height="300" Width="300"
    WindowStyle="None" AllowsTransparency="True"
    Background="Transparent"
    >
  <Window.Resources>
    <LinearGradientBrush x:Key="WindowFrameBrush" StartPoint="0,0.5" EndPoint="1,0.5">
      <GradientStop Color="CadetBlue" Offset="0.4"/>
      <GradientStop Color="Gray" Offset="1"/>
    </LinearGradientBrush>
  </Window.Resources>
  <Border Background="#50FFFFFF" CornerRadius="5" BorderBrush="{StaticResource WindowFrameBrush}" BorderThickness="2,0,2,2">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition Height="30" />
        <RowDefinition/>
      </Grid.RowDefinitions>
      <Border Background="{StaticResource WindowFrameBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
              CornerRadius="5,5,0,0" Margin="-1,0,-1,0" MouseLeftButtonDown="DragWindow">
        <Grid>
          <TextBlock Foreground="White" FontWeight="Bold" VerticalAlignment="Center" Margin="10,2,10,2" 
            Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=Title}"/>
          <Button Content="X" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5" FontSize="7" 
                  Width="15" Height="15" Padding="0" Command="ApplicationCommands.Close"/>
        </Grid>
      </Border>
      <TextBlock Text="This is some text in the window" Grid.Row="1" HorizontalAlignment="Center" 
                 VerticalAlignment="Center" TextWrapping="Wrap" FontSize="32"/>
      <Button Content="Click for new window" Click="ButtonClicked" HorizontalAlignment="Center" 
              VerticalAlignment="Bottom" Grid.Row="1"/>
    </Grid>
  </Border>
</Window>
